package com.cy.pj.controller.service.impl;

import com.cy.pj.controller.BrandDao;
import com.cy.pj.controller.pojo.Brand;
import com.cy.pj.controller.service.BrandService;
import org.slf4j.Logger;//slf4j-Simple Log Facade For Java
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BrandServiceImpl implements BrandService {
    private static final Logger log=//这里的实现在springboot中默认选择的是logback
            LoggerFactory.getLogger(BrandServiceImpl.class);
    @Autowired
    private BrandDao brandDao;

    @Override
    public List<Brand> findBrands(String name) {
        long t1=System.currentTimeMillis();
        List<Brand>  list= brandDao.findBrands(name);
        long t2=System.currentTimeMillis();
        log.info("time:{}",t2-t1);
        return list;
    }
}